package org.flowers.unbeaten.exception.code;

/**
 * @description 通用响应枚举类
 * @author RyanWang
 * @date 2021-07-16 11:42:42
 * @version 1.0
 */
public enum BaseResponseCode implements ResponseCode {

    /*********系统级别操作提示*********/
    OK(200, "操作成功"),
    // LayUI 数据表格默认成功状态码
    SUCCESS(0, "操作成功"),
    SYSTEM_BUSY(500001, "系统繁忙，请稍候再试"),
    FAILURE(500002, "操作失败"),
    DATA_ALREADY_EXISTS(500003, "数据已存在"),

    TOKEN_ERROR(401001, "登录凭证已过期，请重新登录"),
    DATA_ERROR(401003, "传入数据异常"),
    ACCOUNT_NOT_FIND(401004, "该用户不存在,请先注册"),
    USER_LOCK(401005, "该用户已被锁定，请联系运营人员"),
    PASSWORD_ERROR(401006, "用户名或密码错误"),
    METHOD_ARGUMENT_NOT_VALID_EXCEPTION(401007, "方法参数校验异常"),
    UNAUTHORIZED_ERROR(401008, "权鉴校验不通过"),
    ROLE_PERMISSION_RELATION(401009, "该菜单权限存在子集关联，不允许删除"),
    OLD_PASSWORD_ERROR(401010, "旧密码不正确"),
    NOT_PERMISSION_DELETED_DEPARTMENT(401011, "该组织机构下还关联着用户，不允许删除"),
    OPERATION_MENU_PERMISSION_CATALOG_ERROR(401012, "操作后的菜单类型是目录，所属菜单必须为默认顶级菜单或者目录"),
    OPERATION_MENU_PERMISSION_MENU_ERROR(401013, "操作后的菜单类型是菜单，所属菜单必须为目录类型"),
    OPERATION_MENU_PERMISSION_BTN_ERROR(401013, "操作后的菜单类型是按钮，所属菜单必须为菜单类型"),
    OPERATION_MENU_PERMISSION_URL_NOT_NULL(401015, "菜单权限的url不能为空"),
    OPERATION_MENU_PERMISSION_URL_PERMS_NULL(401016, "菜单权限的标识符不能为空"),

    ;

    /**
     * 响应code
     */
    private final int code;

    /**
     * 响应信息
     */
    private final String message;

    BaseResponseCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
